package com.thread;

public class Test_1 {
    public static void main(String[] args) throws InterruptedException {
        Cat cat = new Cat();
        cat.start();

        //
        for(int i=0;i<50;i++){
            System.out.println("main执行"+(i+1));
            Thread.sleep(1000);
        }

    }
}

class Cat extends Thread{
    @Override
    public void run() {
        super.run();
        int count=0;
        while(true) {
            System.out.println("汪汪~"+(++count));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            if(count==50){
                break;
            }
        }

    }
}